#pragma once

#include <iostream>
#include <string>

using namespace std;

#define NUM 1024

const std::string namepipe_path = "./fifo";
mode_t mode = 0666;

int openFile(const string &file, int flags)
{
    int fd = open(file.c_str(), flags);
    if (fd < 0)
    {
        cout << errno << ": " << strerror(errno) << endl;
        exit(2);
    }
    cout << "Open file success" << endl;
    return fd;
}